fix(devframe): dedupe RPC augmentation interfaces in published dist#21
Merged
Conversation
The dual tsdown configs (browser + node) each emitted their own copy of the `DevToolsRpc*` interfaces into a shared dts chunk, so consumer `declare module 'devframe'` augmentations only merged into one copy and left other import chains un-augmented. Add a combined `emitDtsOnly` dts build that runs every entry through a single rolldown graph so the augmentable interfaces have exactly one declaration site, plus a regression test and docs for the augmentation pattern.
✅ Deploy Preview for devfra ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/types/rpc-augments.tswas inlined into a per-build shared dts chunk andDevToolsRpc*interfaces were declared twice indist/; consumerdeclare module 'devframe'augmentations only merged into one copy, leaving import chains that reached the other un-augmented (TS2345downstream invitejs/devtools).tsdown.config.tsinto three configs — keep the client/server runtime split for chunk-graph isolation (nowdts: false) and add a combinedemitDtsOnly: truedts build that processes every entry through one rolldown graph, so each augmentable interface has exactly one declaration site.packages/devframe/test/dts-dedupe.test.tsand document thedeclare module 'devframe'augmentation pattern (DevToolsRpcServerFunctions/DevToolsRpcClientFunctionsindocs/guide/rpc.md,DevToolsRpcSharedStatesindocs/guide/shared-state.md).Test plan
pnpm build— succeeds with norpc-augments-<hash>.d.mtsduplicationpnpm test— 320/320 pass (incl. new dedupe regression); onetsnapisnapshot updated (ws-client.snapshot.d.ts) reflecting re-export form, symbol surface unchangedpnpm lintandpnpm typecheck— cleanvitejs/devtoolsonantfu/devframe-v0.4.0once a release containing the fix is cut:patches/devframe@0.4.0.patchshould drop and theTS2345errors inpackages/{rolldown,self-inspect,vite}should disappear